export const setStorage = (key, val) => {
  if (typeof val === 'number' || typeof val === 'boolean') {
    localStorage.setItem(key, val)
  } else {
    localStorage.setItem(key, JSON.stringify(val))
  }
}

export const getStorage = (key) => {
  return JSON.parse(localStorage.getItem(key))
}

export const removeStorage = (key) => {
  localStorage.removeItem(key)
}

export const clearStorage = () => {
  localStorage.clear()
}
